<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


	<p:panel header="Gerenciar Publicações" style="text-align:left;" >

		<p:panel header="Resumo das Publicações" >
								
				<h:panelGrid id="idTable" >
				<h:panelGrid columns="2">
				
				<h:outputLabel for="empresa" value="Empresa:" />
					<p:selectOneMenu id="empresa">
						<f:selectItem itemLabel="Todos" />
						<f:selectItem itemLabel="Mercedez Industria Automobilistica" itemValue="empresa1" />
						<f:selectItem itemLabel="Ferrari Industria Automobilistica" itemValue="empresa2"/>
						<f:selectItem itemLabel="Neimar Futbool de São Paulo" itemValue="empresa3"/>
					</p:selectOneMenu>
				</h:panelGrid>
								
				    <p:dataTable value="#{resumoPublicacaoMB.listResulAtual}" var="result" rowClasses="impar,par">
					<p:column headerText="Tipo de Mídia">
						#{result.tipoMidia}
					</p:column>	
					<p:column headerText="Qtde de Publicações">
						#{result.qtdPublicacoes}
					</p:column>
					<p:column headerText="RACE Total">
						#{result.roiTotal}
					</p:column>
				</p:dataTable>
	           </h:panelGrid>
		</p:panel>
		<br/><br/>
		
		<p:panel header="Publicações" style="text-align:left;" >	
						<h:panelGrid columns="6">
							<p:commandButton value="Lançar Publicação" onclick="dlgSelMidia.show();" />
							<p:commandButton value="Filtro Avançado" onclick="dlgFiltroAvancadoPublic.show();" />
							
							
  

						</h:panelGrid>
							
							 <p:dataTable id="tabelaPublicacoes" paginator="true" rows="2" var="result" value="#{publicacaoMBean.listResulAtual}"  widgetVar="resultTable" 
								  filteredValue="#{publicacaoMBean.filteredResultAtual}" emptyMessage="Nenhuma informação cadastrada" >    
								        <f:facet name="header">  
								            <p:outputPanel>  
								                <h:outputText value="Procurar em todos os campos:" />  
								                <p:inputText id="globalFilter" onkeyup="resultTable.filter()"  style="width:100px" />  
								            </p:outputPanel>  
								        </f:facet> 
								       <p:column id="modelColumn"
								                headerText="Empresa">  
								            <h:outputText value="#{result.empresa}" />  
								       </p:column>  
								       <p:column id="tituloColumn"
								                headerText="Titulo">  
								            <h:outputText value="#{result.titulo}" />  
								       </p:column>
								      <p:column id="yearColumn"  headerText="Impacto" filterMatchMode="exact" >  
								            <h:outputText value="#{result.impacto}" />  
								       </p:column>   
									   <p:column headerText="Dt. Publicação"  filterMatchMode="exact">  
									           <h:outputText value="#{result.dtPublicacao}" />  
									   </p:column>  				  
									   <p:column headerText="RACE."  filterMatchMode="endsWith">  
									           <h:outputText value="#{result.race}" />  
									   </p:column>
									   
									   <p:column headerText="Visualizar"  filterMatchMode="endsWith">  
									        <p:growl id="growl" sticky="true" showDetail="true"/>  
  											<p:commandLink id="abrirDialogDetalhe" value="Detalhes" onclick="dlgVisualizaDetalhePublic.show()"/>    
									   </p:column>
									    <p:column headerText="Ações"  filterMatchMode="exact">  
									           <p:commandLink value="Alterar" /> /
									           <p:commandLink value="Excluir"  onclick="confirmation.show()" />   
 
									   </p:column>
									   
							</p:dataTable> 
					
				</p:panel>	
				
				
</p:panel>

</html>